import { createStore, combineReducers, applyMiddleware } from 'redux'
import { count } from './reducer/count'
import createSaga from 'redux-saga'
import rootSaga from './saga'

// 生成saga中间件
let sagaMiddleware = createSaga()
// console.log(sagaMiddleware)

let reducer = combineReducers({
    count
})

let store = createStore(reducer, applyMiddleware(sagaMiddleware))

// run  运行所有的*函数
sagaMiddleware.run(rootSaga)

export default store
